<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center setBlacklist_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub setBlacklist_fd0_0'>
				<view class='flex flex-wrap align-center'>
					<person></person>
				</view>
				<view class='flex flex-wrap align-stretch justify-center flex-sub'>
					<text class='setBlacklist_fd0_0_c1_c0'>我的关注</text>
				</view>
				<view class='flex flex-wrap align-center setBlacklist_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#6A0002"></u-loading>
			<view class="loading_text">加载中</view>
		</view>
		<!---flex布局flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout" v-else>
			<view style="margin: 8rpx 32rpx 0;">
				<back></back>
			</view>
			<view class='flex flex-wrap setBlacklist_fd1_0' v-for="(item,index) in list" :key="index">
				<image class='setBlacklist_fd1_0_c0' mode="aspectFill" :src='item.head_img'></image>
				<view class='flex flex-direction flex-wrap align-stretch flex-sub setBlacklist_fd1_0_c1'>
					<view class='flex flex-wrap align-center'>
						<text class='setBlacklist_fd1_0_c1_c0_c0'>{{item.user_nickname}}</text>
						<button class='setBlacklist_fd1_0_c1_c0_c1' @tap.stop="getFollow(item.id)">取消关注</button>
					</view>
					<view class='flex flex-wrap align-center setBlacklist_fd1_0_c1_c1'>
						<text class='setBlacklist_fd1_0_c1_c1_c0'>性别：</text>
						<text class='setBlacklist_fd1_0_c1_c1_c0'>{{item.sex == 1 ? '男' : '女'}}</text>
						<block v-if="item.age">
							<text class='setBlacklist_fd1_0_c1_c1_c2'>年龄：</text>
							<text class='setBlacklist_fd1_0_c1_c1_c0'>{{item.age}}</text>
							<text class='setBlacklist_fd1_0_c1_c1_c0'>岁</text>
						</block>

						<block v-if="item.height">
							<text class='setBlacklist_fd1_0_c1_c1_c2'>身高：</text>
							<text class='setBlacklist_fd1_0_c1_c1_c0'>{{item.height}}</text>
						</block>
						<block v-if="item.weight">
							<text class='setBlacklist_fd1_0_c1_c1_c2'>体重：</text>
							<text class='setBlacklist_fd1_0_c1_c1_c0'>{{item.weight}}</text>
						</block>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='setBlacklist_fd1_0_c1_c2_c0'>关注时间：</text>
						<text class='setBlacklist_fd1_0_c1_c2_c0'>{{item.create_time}}</text>
					</view>
				</view>
			</view>
			<u-loadmore v-if="last_page > 1" class="loadmore" font-size="24" :status="status"
				:icon-type="iconType" :load-text="loadText" />
		</view>
		<view class="noData" v-if="list.length == 0 && !isShow">
			<image src="/static/empty/no.png"></image>
		</view>

		<!---flex布局flex布局结束-->


	</view>
</template>
<script>
	import back from "@/components/back/index.vue"
	import person from "@/components/person/index.vue"
	export default {
		components: {
			back,
			person
		},


		data() {
			return {
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			// showme_133
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getmingdan();
		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getmingdan();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {
		
				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getmingdan();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			getmingdan() {
				this.$api.post(global.apiUrls.a64732417c9019,{
					page: this.page
				}).then(res => {
					// console.log(res);
					if (res.data.code == 1) {
						uni.stopPullDownRefresh();
						this.isShow = false;
						if (res.data.code == 1) {
							this.last_page = res.data.data.last_page;
							if (this.is_pull) {
								this.list = res.data.data.data;
							} else {
								this.list = this.list.concat(res.data.data.data);
							}
						} else {
							this.$message.info(res.data.msg);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			// 取消关注
			getFollow(id) {
				this.$api.post(global.API_VERSION + '/647322fb760b6', {
					user_id: id
				}).then(res => {
					this.$message.info(res.data.msg);
					if (res.data.code == 1) {
						this.page = 1;
						this.is_pull = true;
						this.isShow = true;
						this.getmingdan();
					}
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: var(--benbenbgColor0);
		background-size: 100% auto !important;
	}

	.setBlacklist_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.setBlacklist_fd0_0_c2 {
		width: 32rpx;
		height: 32rpx;
	}

	.setBlacklist_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.setBlacklist_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.setBlacklist_fd0_0 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.setBlacklist_fd1_0_c1_c2_c0 {
		color: #999999;
		font-size: 20rpx;
		font-weight: 400;
	}

	.accountCancellationSubmission_fd1_0 {
		margin-top: 140rpx;
		margin-left: 40rpx;
	}

	.setBlacklist_fd1_0_c1_c1_c2 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 500;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.setBlacklist_fd1_0_c1_c1_c0 {
		color: #666666;
		font-size: 22rpx;
		font-weight: 500;
	}

	.setBlacklist_fd1_0_c1_c1 {
		margin: 16rpx 0rpx 8rpx 0rpx;
	}

	.setBlacklist_fd1_0_c1_c0_c1 {
		background: #EEEEEE;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 24rpx;
		color: var(--benbenFontColor0);
		width: 144rpx;
		height: 40rpx;
		margin: 0rpx 0rpx 0rpx auto;
		line-height: 40rpx;
	}

	.setBlacklist_fd1_0_c1_c0_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 500;
	}

	.setBlacklist_fd1_0_c1 {
		border-bottom: 1px solid #eee;
		margin: 0rpx 0rpx 0rpx 16rpx;
		padding: 0rpx 0rpx 32rpx 0rpx;
	}

	.setBlacklist_fd1_0_c0 {
		width: 104rpx;
		height: 104rpx;
		border-radius: 52rpx 52rpx 52rpx 52rpx;
	}

	.setBlacklist_fd1_0 {
		padding: 32rpx 32rpx 32rpx 32rpx;
	}
</style>